/*
 * @Author: error: git config user.name && git config user.email & please set dead value or install git
 * @Date: 2022-08-16 08:59:08
 * @LastEditors: error: git config user.name && git config user.email & please set dead value or install git
 * @LastEditTime: 2022-08-21 12:44:43
 * @FilePath: \四阶段项目\src\components\workorder\RecordworkOrder.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import React from 'react'
import {inject,observer} from 'mobx-react'
import { Button,Table } from 'antd';

function RecordworkOrder(props) {

  // const [data,setData]=useState({})
  // useEffect(() => {
  //   const data=toJS(props.workOrderStore.RecordworkOrderList)
  //   setData(data)
  //   console.log(data);
  // }, [props.workOrderStore.RecordworkOrderList]);
  const columns = [
    {
      title: 'ID',
      dataIndex: 'record_id',
      key: 'record_id',
    },
    {
      title: '发起者',
      dataIndex: 'user_name',
      key: 'user_name',
    },
    {
      title: '问题描述',
      dataIndex: 'problem_description',
      key: 'problem_description',
    },
    {
      title: '处理结果',
      key: 'processing_results',
      dataIndex: 'processing_results',
    },
    {
      title: '发起时间',
      key: 'initiate_time',
      dataIndex: 'initiate_time',
    },
    {
      title: '反馈状态',
      key: 'feedback_status',
      dataIndex: 'feedback_status',
      render:(feedback_status)=> <button >{feedback_status===0?'我要反馈':'已经处理'}</button>
    },
    {
      title: '管理',
      key: 'action',
      dataIndex: 'action',
      render:()=> <button >删除</button>
    },
  ];
  return (
    <div>
    <Button >工作记录</Button>
    <Button >新增问题</Button>
    <div>
    <span>查看该工单详情</span>
    </div>
    <div>
    <Table columns={columns} dataSource={props.workOrderStore.RecordworkOrderList} pagination={false} rowKey='record_id' />
    </div>
    </div>
  )
}

export default inject('workOrderStore')(observer(RecordworkOrder))